/*
 * User.fx
 *
 * Created on 18.2.2010, 23:46:
 */

package com.gpsbuddy.services;

import java.lang.StringBuffer;

/**
 * @author jonycus
 */

public class User {

        public var id:Integer;
        public var username:String;
        public var password:String;
        public var email:String;
        public var name:String;
        public var surname:String;

        public function toXML():String {
            var xml:StringBuffer = StringBuffer {};
            xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            xml.append("<users>");
            xml.append("<user>");
            xml.append("<id>");
            xml.append(id);
            xml.append("</id>");
            xml.append("<email>");
            xml.append(email);
            xml.append("</email>");
            xml.append("<username>");
            xml.append(username);
            xml.append("</username>");
            xml.append("<password>");
            xml.append(password);
            xml.append("</password>");
            xml.append("<name>");
            xml.append(name);
            xml.append("</name>");
            xml.append("<surname>");
            xml.append(surname);
            xml.append("</surname>");
            xml.append("</user>");
            xml.append("</users>");
            return xml.toString();
        }

        public function toShortXML():String{
            var xml:StringBuffer = StringBuffer {};
            xml.append("<id>");
            xml.append(id);
            xml.append("</id>");
            xml.append("<email>");
            xml.append(email);
            xml.append("</email>");
            xml.append("<username>");
            xml.append(username);
            xml.append("</username>");
            xml.append("<password>");
            xml.append(password);
            xml.append("</password>");
            xml.append("<name>");
            xml.append(name);
            xml.append("</name>");
            xml.append("<surname>");
            xml.append(surname);
            xml.append("</surname>");
            return xml.toString();
        }



}
